#include "widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    resize(600,400);
    setFixedSize(600, 400);
    setWindowTitle("第一个窗口");

    QPushButton * btn = new QPushButton;
    btn->setParent(this);
    btn->setText("第一个按钮");

    QPushButton * btn2 = new QPushButton("第二个按钮", this);
    btn2->move(100,100);

    QPushButton * delBtn = new QPushButton("关闭按钮", this);
    delBtn->move(500,0);

    connect(delBtn, &QPushButton::clicked, this, &QWidget::close);
    QPushButton *btn3 = new QPushButton("第三个按钮", this);
    btn3->move(0,200);

}

Widget::~Widget()
{
}

